window.onload=function () {
    AllNotice();
}
function NewTen() {
    $.get("/notice/history/NewTen",
        function (data) {
            if(data.code!=500){
                var noticeList=data.data;
                var str="";
                for (let i = 0; i < noticeList.length; i++) {
                    str+=
                        "                        <div class=\"card shadow  col-lg-11\">\n" +
                        "                            <!-- Card Header - Accordion -->\n" +
                        "                            <a href=\"#collapseCardExample"+i+"\" class=\"d-block card-header py-3  collapsed\" data-toggle=\"collapse\"\n" +
                        "                               role=\"button\" aria-expanded=\"false\" aria-controls=\"collapseCardExample"+i+"\">\n" +
                        "                                <h6 class=\"m-0 font-weight-bold text-dark col\">"+noticeList[i].title+"<span class=\"font-weight-light text-gray-600\" style=\"float:right\">"+noticeList[i].creator+"@"+noticeList[i].gmtCreate+"</span></h6>\n" +
                        "                            </a>\n" +
                        "                            <!-- Card Content - Collapse -->\n" +
                        "                            <div class=\"collapse  \" id=\"collapseCardExample"+i+"\">\n" +
                        "                                <div class=\"card-body\">\n" +
                        noticeList[i].content+
                        "                                </div>\n" +
                        "                            </div>\n" +
                        "                        </div>"
                }
                $("#NoticeCard").html(str);
            }else{
                alert(data.msg);
            }
        })
}

function PassMonth() {
    $.get("/notice/history/PassMonth",
        function (data) {
            if(data.code!=500){
                var noticeList=data.data;
                var str="";
                for (let i = 0; i < noticeList.length; i++) {
                    str+=
                        "                        <div class=\"card shadow  col-lg-11\">\n" +
                        "                            <!-- Card Header - Accordion -->\n" +
                        "                            <a href=\"#collapseCardExample"+i+"\" class=\"d-block card-header py-3  collapsed\" data-toggle=\"collapse\"\n" +
                        "                               role=\"button\" aria-expanded=\"false\" aria-controls=\"collapseCardExample"+i+"\">\n" +
                        "                                <h6 class=\"m-0 font-weight-bold text-dark col\">"+noticeList[i].title+"<span class=\"font-weight-light text-gray-600\" style=\"float:right\">"+noticeList[i].creator+"@"+noticeList[i].gmtCreate+"</span></h6>\n" +
                        "                            </a>\n" +
                        "                            <!-- Card Content - Collapse -->\n" +
                        "                            <div class=\"collapse  \" id=\"collapseCardExample"+i+"\">\n" +
                        "                                <div class=\"card-body\">\n" +
                        noticeList[i].content+
                        "                                </div>\n" +
                        "                            </div>\n" +
                        "                        </div>"
                }
                $("#NoticeCard").html(str);
            }else{
                alert(data.msg);
            }
        })
}

function AllNotice() {
    $.get("/notice/history/AllNotice",
        function (data) {
            if(data.code!=500){
                var noticeList=data.data;
                var str="";
                for (let i = 0; i < noticeList.length; i++) {
                    str+=
                        "                        <div class=\"card shadow  col-lg-11\">\n" +
                        "                            <!-- Card Header - Accordion -->\n" +
                        "                            <a href=\"#collapseCardExample"+i+"\" class=\"d-block card-header py-3  collapsed\" data-toggle=\"collapse\"\n" +
                        "                               role=\"button\" aria-expanded=\"false\" aria-controls=\"collapseCardExample"+i+"\">\n" +
                        "                                <h6 class=\"m-0 font-weight-bold text-dark col\">"+noticeList[i].title+"<span class=\"font-weight-light text-gray-600\" style=\"float:right\">"+noticeList[i].creator+"@"+noticeList[i].gmtCreate+"</span></h6>\n" +
                        "                            </a>\n" +
                        "                            <!-- Card Content - Collapse -->\n" +
                        "                            <div class=\"collapse  \" id=\"collapseCardExample"+i+"\">\n" +
                        "                                <div class=\"card-body\">\n" +
                        noticeList[i].content+
                        "                                </div>\n" +
                        "                            </div>\n" +
                        "                        </div>"
                }
                $("#NoticeCard").html(str);
            }else{
                alert(data.msg);
            }
        })
}